#ifndef EGG_TEXTURE2D_H
#define EGG_TEXTURE2D_H

#include "Texture.h"

namespace egg{

    class Texture2D : public Texture{
    public:
        Texture2D(const Image2D& _img);
        Texture2D(PixelFormat _format,uint32 _w,uint32 _h);
        ~Texture2D();
        void writePixels(const void* _data);
        void readPixels(void* _dest);
        void resize(uint32 _w,uint32 _h);

        inline PixelFormat getPixelFormat(){
            return mPixelFormat;
        }
        inline uint32 getWidth(){
            return mWidth;
        }
        inline uint32 getHeight(){
            return mHeight;
        }
    protected:
        void innerBuild(uint32 _w,uint32 _h,const void* _pixels);
    protected:
        uint32 mWidth;
        uint32 mHeight;
        bool mNeedMipMap;
        PixelFormat mPixelFormat;
        DevicePixelFormat mDevicePixelFormat;
    };

    typedef shared_ptr<Texture2D> Texture2DPtr;

}

#endif